It is usually necessary to render cubic curves in computer aided design or in the field of computer graphics for displaying characters which are an outline font. The approximate approach of the Bezier curve for the cubic curve is one of the methods most widely used.
There are two primary methods for generating Bezier curves in a computer system. The first is the method of Adaptive Subdivision and the second is the method of Forward Difference.
As shown in "A Theoretical Development for the Computer Generation and Display of Piecewise Polynomial Surfaces" IEEE Transactions on Pattern Analysis and Machine Intelligence, Jan. 1980, the principle of Adaptive Subdivision for Bezier curve is as follows: ##EQU1##
With reference to FIG. 2, there are four original control points P.sub.00, P.sub.01, P.sub.02, and P.sub.03, from which three corresponding middle points P.sub.11, P.sub.12, and P.sub.13 are derived. Subsequently, two middle points P.sub.22 and P.sub.23 with respect to the above three middle points are obtained. Finally, the middle point P.sub.33 of the points P.sub.22 and P.sub.23 is the point where the parameter u in the above equations is equal to 0.5. From the set of the control points P.sub.00, P.sub.11, P.sub.22, and P.sub.33 and the set of the control points P.sub.33, P.sub.23, P.sub.13, and P.sub.03, the first and second half segments of the original curve can be generated, respectively. If the space of the parameter u ranges from 0.0 to 1.0, the first half segment is related to the parameter u from 0.0 to 0.5 and the second half segment is related to the parameter u from 0.5 to 1.0.
If the two new sets of control points continue to be divided, many new control points with equal space can be obtained. According to the absolute convergence of the Bezier curve, the new control points can be further approximate to the original curve as the division segment becomes much smaller.
The binary approximation algorithm is most well illustrated by a binary tree as shown in FIG. 3. A primary set of control points C which consists of four control points may generate two subsets of control points LC and RC, which may further generate LLC, RLC, LRC, and RRC as the final output in the binary tree. Thus, the above Adaptive Subdivision is very close to the method of Depth-First Transversal in the conventional binary tree. The data in the right subset of control points are stored in a stack memory and the left subset of control points are used as the source data for the next division when the present division process is finished. If the subset of control points to be divided meets the requirement of convergence, i.e., the four control points of the subset are in the same straight line, the subset is used to render a curve and stops being further divided and the right subset, previously pushed into the stack memory, is used as the source data for the next division process. The above-mentioned process is repeated until there is no available data.
The method of Adaptive Subdivision has four advantages. First, the input and output data are consistent in format, i.e., both the source and output data are control points. If there are multiple Bezier generators, the desired curve can be implemented in parallel by suitable series connection. Second, only a simple operation using an adder and a shifter is needed and can be implemented easily by a hardware circuit or a microprogram. Third, according to the convergence condition for determining which level of division is necessary, good output data can be derived from any curve with rigorous variation. Fourth, if the curve crosses over the visible window, the top-down division process can screen those unnecessary operations out of the visible window.
However, the method of Adaptive Subdivision has some disadvantages. First, it is necessary to have one set of rapid stack memory used to temporarily store the control points and to pull out the stored data. Second, every node in the binary tree has to be processed while using the binary tree to perform track operation. However, only the final node is needed and those operations for the middle points are unnecessary.
With regard to Forward Difference, the principle of difference is used. Define the forward difference as .DELTA.f(t)=f(t+.delta.)-f(t), where .delta.&gt;0. When f.sub.n =f(t.sub.n) and t.sub.n =n.multidot..delta., f.sub.n+1 =f.sub.n +.DELTA.f.sub.n. In addition, .DELTA.f.sub.n+1 =.DELTA.f.sub.n +.DELTA..sup.2 f.sub.n, .DELTA..sup.2 f.sub.n+1 =.DELTA..sup.2 f.sub.n +.DELTA..sup.3 f.sub.n. Assuming a polynomial f(t)=a+bt+ct.sup.2 +dt.sup.3,
.DELTA.f(t)=3dt.sup.2.delta.+t(3d.delta..sup.2 +2c.delta.)+d.delta..sup.3 +c.delta..sup.2 +b.delta.. EQU .DELTA..sup.2 f(t)=.DELTA.(.DELTA.f(t))=6.delta.d.sup.2 t+6d.delta..sup.3 +2c.delta..sup.2. EQU .DELTA..sup.3 f(t)=.DELTA.(.DELTA..sup.2 f(t))=6d.delta..sup.3.
We can calculate the initial condition: f.sub.0 =a, .DELTA.f.sub.0 =d.delta..sup.3 +c.delta..sup.2 +b.delta., .DELTA..sup.2 f.sub.0 =6d.delta..sup.3 +2c.delta..sup.2, .DELTA..sup.3 f.sub.0 =6d.delta..sup.3. Subsequent data can be derived as follows: EQU f.sub.i+1 =f.sub.i +.DELTA.f.sub.i, .DELTA.f.sub.i+1 =.DELTA.f.sub.i +.DELTA..sup.2 f.sub.i, .DELTA..sup.2 f.sub.i+1 =.DELTA..sup.2 f.sub.i +.DELTA..sup.3 f.sub.0.
The method of Forward Difference has two advantages. First, only one step is required to rapidly generate desired points for rendering a curve by using three adders. Second, not only Bezier curves, but also any type of cubic curves can be rendered.
The method of Forward Difference still has three disadvantages. First, it is necessary to transform the Bezier curve with the geometrical parameter into a cubic polynomial by a pre-process of floating point multiplication. Second, the value of difference has to be fixed and is very difficult to determine, especially where the curvature varies so significantly that good output data are hard to obtain. This is the most serious disadvantage. Third, although the present part of computation is out of the visible window, it is still necessary to perform the computation because the computation has to be accomplished point by point.
To solve the above disadvantages, a paper titled "Adaptive Forward Differencing for Rendering Curves and Surfaces" Computer Graphics, July 1987, provides a modified method of Adaptive Forward Difference (AFD). First, the Bezier curve which takes control points as the parameters is transformed into a polynomial based on AFD as follows: EQU f(t)=a.sub.0 A.sub.0 (t)+a.sub.1 A.sub.1 (t)+a.sub.2 A.sub.2 (t)+a.sub.3 A.sub.3 (t), where
A.sub.k (t)=((t-k+1)/k)*A.sub.k-1 and A.sub.0 (t)=1. That is, when t=0, the basis of AFD comprises: A.sub.0 (t)=1, A.sub.1 (t)=t, A.sub.2 (t)=(1/2)(t)(t-1), and A.sub.3 (t)=(1/6)(t)(t-1)(t-2). When t=t+1, the basis of AFD comprises: A.sub.0 (t+1)=1=A.sub.0 (t), A.sub.1 (t+1)=A.sub.0 (t)+A.sub.1 (t), A.sub.2 (t+1)=A.sub.1 (t)+A.sub.2 (t), and A.sub.3 (t+1)=A.sub.2 (t)+A3(t).
The new basis is brought into the polynomial to obtain: EQU f(t+1)=(a.sub.0 +a.sub.1)A.sub.0 (t)+(a.sub.1 +a.sub.2)A.sub.1 (t)+(a.sub.2 +a.sub.3)A.sub.2 (t)+a.sub.3 A.sub.3 (t),
which illustrates the relation with the old basis.
Therefore, E, L, R, and P represent the operation matrices of the AFD basis matrix EQU A=[A.sub.0 (t),A.sub.1 (t),A.sub.2 (t),A.sub.3 (t)]
with respect to f(t+1), f(t/2), f(t/2+1), and f(2t), respectively, where ##EQU2##
Theoretically, the method of Adaptive Forward Difference has the advantage of rapid operation in Forward Difference and can also be adapted to the division level in each step. With reference to FIG. 4, as an example, Adaptive Forward Difference does not only have L and R operations as in Adaptive Subdivision or only E operation as in Forward Difference, but has four operations of L, R, E, and P.
However, the method of determining the division level is arguable because it is not rigorous enough to determine the convergence from the distance between the present and the previous points. With reference to FIG. 5, the distance between the first point P.sub.0 and the last point P.sub.3 is zero, but the curve is not convergent. Thus, the speed of rendering curves is fast if the condition of convergence is loose, but the speed will become slow and it becomes a bottleneck if the condition is too rigorous.
In summary, the methods of Adaptive Subdivision and Adaptive Forward Difference in the prior arts have disadvantages as follows:
(1) Adaptive Subdivision needs a stack memory device such that the efficiency of system operation is greatly reduced due to the large amount of processing in stack access; and the performance of division is also poor.
(2) Adaptive Forward Difference needs to transform the parametric formula of a Bezier curve into a AFD basis formula, which takes substantial time to perform the floating point operation.
(3) The output of Adaptive Forward Difference is in a format of points instead of a set of control points such that many properties of Bezier curve are not available. For example, the property of convex hull for a Bezier curve is used to determine if the curve is out of the visible window and to rapidly skip the unnecessary computation. Furthermore, the tangential line of the curve can be determined by control points. It is greatly desired information for a shading process in computing an angle between a light source and an object.